@extends('layouts.header')
@section('content')
    <div class="page-container">
        <div class="cl pd-5 bg-1 bk-gray">
            <span class="">
                <a href="exportLog?id={{request('id')}}" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe644;</i> 导出</a>
            </span>
        </div>
        <div class="mt-20">
            <table class="table table-border table-bordered table-hover table-bg" id="datatable">
                <thead>
                <tr class="text-c">
                    <th class="hidden"></th>
                    <th>上报时间</th>
                    <th>温度</th>
                    <th>湿度</th>
                    <th>大气压</th>
                </tr>
                </thead>
                <tbody>
                    @foreach($data as $item)
                    <tr class="text-c">
                        <td class="hidden"></td>
                        <td>{{$item->time}}</td>
                        <td>{{$item->temp}}</td>
                        <td>{{$item->humi}}</td>
                        <td>{{$item->pressure}}</td>
                    </tr>
                    @endforeach
                </tbody>
            </table>
        </div>
    </div>

    <script type="text/javascript">
        var table;
        $(function () {
            $.fn.dataTable.ext.errMode = 'throw'; //datatable抛异常的方式，在console中输出，默认以alert的方式弹出
            table = $('#datatable').DataTable();
        })
    </script>
@endsection